/* License Notice:
**
** This program is free software: you can redistribute it and/or modify
**    it under the terms of the GNU General Public License as published by
**    the Free Software Foundation, either version 3 of the License, or
**    (at your option) any later version.
** This program is distributed in the hope that it will be useful,
**   but WITHOUT ANY WARRANTY; without even the implied warranty of
**   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
**   GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
**   along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

/**
 * @file shader.vert
 * @author TooOld2Rock'nRoll
 * @date 2022/Ago
 * @remark Last modified in 2023/set
 *
 * @brief Vertex Shader program for the ArcadeFighter library.
 *
 * Originally this code was part of Breakout, now part of ArcadeFighter library
 *  and was modified by the author as a exercise.<br>
 * Breakout is free software: you can redistribute it and/or modify
 *   it under the terms of the CC BY 4.0 license as published by
 *   Creative Commons, either version 4 of the License, or (at your
 *   option) any later version.
 *
 * @see https://learnopengl.com/Getting-started/Shaders
 * @see https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language
 * @see https://www.khronos.org/opengl/wiki/Vertex_Shader
 *
 * @todo use the z coordinate of the vertex_pos.
 */

//The minimum version of OpenGl that this program supports.
#version 330 core

//Texture Unit, not in use for now, see sprite2D.hpp for more info
//layout (location = 0)

in vec2 vertex_pos; ///< the vertex position
in vec2 texture_uv; ///< the texture coordinates to render

out vec2 TexCoords; ///< forward the texture coordinate to the Fragment Shader

uniform mat4 model; ///< transformation applied to the mesh
uniform mat4 view; ///< "camera" position
uniform mat4 projection; ///< which projection to use when rendering

/**
 * @brief The main method of the Vertex Shader.
 */
void main ()
{
    TexCoords = texture_uv;
    gl_Position = projection * (view * (model * vec4(vertex_pos.xy, 0.0, 1.0)));
}//END main ()

